package Control;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import Control.*;
import Dao.SpringMVC_StudentsInformationDao;
import Entity.Student;

@Controller
@RequestMapping("/StudentInformationControl")
public class StudentInformationControl {
	@Autowired
	SpringMVC_StudentsInformationDao sid;
	List<Student> slist = new ArrayList<Student>();

	@RequestMapping(value = "/showallstudent", method = RequestMethod.GET)
	public String showAllStudent(ModelMap model) {
		slist = sid.showAllStudents();
		model.addAttribute("allStudents", slist);
		return "showAllStudents"; ///UniversityResourceSystem/WebContent/JSP_administrator/showAllStudents.jsp
	}
}
